import "reflect-metadata";
import { Type, instanceToPlain, Transform } from "class-transformer";

class People {
  @Type()
  name: string;
  @Type(() => Number)
  age: number;
}

const people = new People();
people.name = 111 as any;
people.age = "123" as any;
const result = instanceToPlain(people, { strategy: "exposeAll" });
console.log("result.name type", typeof result.name, result.name);
console.log("result.age type", typeof result.age, result.age);
//问题：
// 1.由于SDK默认关闭emitDecoratorMetadata选项，所以Type的参数必须是必填类型，否则转换不成功
// 2.import "reflect-metadata" 不支持，需要改成 import * as rm "reflect-metadata"且必须显式访问rm，写了让人无法理解的代码
